<template>
    <div>
        <h1>显示用户信息</h1>     
        <table class="table">
            <thead>
                <tr>
                    <th>编号</th>
                    <th>账号</th>
                    <th>密码</th>
                    <th>手机号</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="a in data">
                    <th>{{ a.Id }}</th>
                    <th>{{a.UserZH}}</th>
                    <th>******</th>
                    <th>{{a.Phone.substring(0,3)+"****"+a.Phone.substring(7,12)}}</th>
                </tr>
            </tbody>
            <a href="/Add"> <h3>添加机构信息</h3> </a>
            <a href="/ShowJoin"> <h3>显示机构信息</h3> </a>
        </table>
    </div>
</template>

<script setup lang="ts">
    import { ref,onMounted } from 'vue';
    import axios from 'axios';
    const data = ref([{
        "Id": 1,
        "UserZH": "",
        "UserPwd": "",
        "Phone": ""
    }])
    onMounted(()=>{
        Show()
    })
    const Show=()=>{
        axios.get("https://localhost:7018/api/User/GetUsers").then(res=>{
            data.value = res.data
        })
    }
</script>

<style scoped>

</style>